const { merge } = require("webpack-merge");

const baseWebpackConfig = require("./webpack.config.base");
const NodemonPlugin = require("nodemon-webpack-plugin");

const webpackconfig = merge(baseWebpackConfig, {
  devtool: "eval-source-map",
  mode: "development",
  stats: { children: false },
  plugins: [
    new NodemonPlugin({
      watch: ["./src"],
      ignore: ["./node_modules"],
      verbose: true,
      ext: "js,json,ts",
    }), // Dong
  ],
  // 开发环境优化配置
  optimization: {
    moduleIds: "named",
    removeAvailableModules: false,
    removeEmptyChunks: false,
    splitChunks: false,
  },
});

module.exports = webpackconfig;
